package com.hxzy.vo;

import java.io.Serializable;

/**
 * @author nick
 */
public class Result implements Serializable {//允许对Result的对象进行序列化
    /*
        序列化的对象必须提供序列化版本号
        IDEA默认不会提供生成序列化版本号的方法；需要配置打开
        settings -> editor -> Inspections -> 右侧选择java -> SerializableIssue -> 勾选Serializable class without serialVersionUID
     */
    private static final long serialVersionUID = 9196829146985671807L;

    //状态码
    private int code;

    //状态码对应的描述信息
    private String message;

    //响应的对象
    private Object data;

    public static long getSerialVersionUID() {
        return serialVersionUID;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public static Result success(){
        Result result = new Result();
        result.setCode(0);
        result.setMessage("操作成功");

        return result;
    }
}
